<template>
	<view class="fabu">
		<view class="display-flex" style="padding-top: 166px;justify-content: center;" v-if="noNetwork">
			<image src="/static/images/network.png" mode="aspectFit" style="width: 152px;height: 170px;"></image>
			
			<!-- <tabbar activeIdx='2'></tabbar> -->
		</view>
		<view class="mode-bom" v-else>
			<u-navbar  bgColor="#fff" :placeholder="true" :fixed="true" title="发布内容" titleStyle="{'color': '#000'}" :style="{opacity: showLogin ? 0 : 1}">
				<view slot="left"></view>
			</u-navbar>
			
			<view class="im-fri" @click="$goto('/pages/finance/fabu?type=1')">
				<image class="img_a" :src="'/images/ss2.png' | formatImgUrl" mode=""></image>
				<view class="tex">
					<view class="weig">文字发布</view>
					<view class="min">遇见有趣的灵魂</view>
				</view>
				<image class="img_b" :src="'/images/ss3.png'  | formatImgUrl" mode=""></image>
			</view>

			<view class="con">
			</view>

			<view class="im-fri back" @click="$goto('/pages/finance/fabu?type=2')">
				<image class="img_a" :src="'/images/ss1.png' | formatImgUrl" mode=""></image>
				<view class="tex">
					<view class="weig"> 图片发布</view>
					<view class="min">看见不同的色彩</view>
				</view>
				<image class="img_b" :src="'/images/ss3.png'  | formatImgUrl" mode=""></image>
			</view>


			<!-- <view class="im-thr">
				<image class="las-mg " @click="go_back()" :src="'/images/fb_3.png' | formatImgUrl" mode=""></image>
			</view> -->

		</view>
		
		<u-popup mode="bottom" :show="showLogin" @close="showLogin=false">
			<view class="pop-login display-flex">
				<view class="pop-close"  @tap.stop="showLogin=false">
					<image :src="'/images/pop-close.png' | formatImgUrl" class="" mode=""></image>
				</view>
				
				
				<view class="pop-title">
					登录发现遇到灵感
				</view>
				<image :src="'/images/pop-logo.png' | formatImgUrl" class="pop-logo" mode=""></image>
				<view class="pop-btn" @click="showLogin=false,$goLogin('/pages/login/phone')">
					手机号码登录
				</view>
				<view class="pop-btn" @click="showLogin=false,$goLogin('/pages/login/account')">
					账号密码登录
				</view>
				<view class="xiebox" @click="isRead =( isRead == 2?0:2)" :class="isRead == 1 ? 'shake-horizontal' : ''">
					<label>
						<u-checkbox shape="circle" size="14" :checked="isRead" activeColor="#45C4B0" inactiveColor="#999" @change="changeBox"></u-checkbox>
					</label>
					<view class="xietxt">
						我已阅读并同意：<text @click.stop="goToxie">《服务协议》</text>和<text @click.stop="goToOtherxie(14)">《隐私政策》</text>
					</view>
				</view>
			</view>
		</u-popup>
	</view>
</template>
<script>
	import * as db from '@/common/db.js'
	export default {
		data() {
			return {
				// 是否关注
				isguan: true,
				// 点击切换
				navList: [{
					id: 1,
					name: '约文'
				}, {
					id: 2,
					name: '评价'
				}, {
					id: 3,
					name: '动态'
				}],
				navIndex: 1,
				// 沟通弹框
				show: false,
				uid: this.$db.get('userInfo').membe_id,
				userInfo: {},
				list: {},
				page: 1,
				rowList: [],
				showdel: false,
				aid: 0,
				noNetwork: false,
				isRead: false,
				showLogin: false
			}
		},
		onShow() {
			// this.getUserInfo()
			
			this.getNetworkType()
		},
		onLoad(option) {
			console.log(option.id)
			if (option.id) {
				this.uid = option.id
			}
			// this.getUserInfo()
		},

		// 上拉加载
		onReachBottom() {
			if (this.list.current_page < this.list.last_page) {
				this.page++; // 页数加一，加载下一页数据
				this.getList();
			}
		},
		// onTabItemTap(e){
		// 	if(!db.get('auth')){
		// 		this.showLogin = true
		// 	}
		// },
		methods: {
			changeBox(e){
				this.isRead = e ? 2 : 0
			},
			$goto(url){
				let auth = db.get('auth');
				if (!auth) {
					uni.navigateTo({
						url: '/pages/login/login'
					})
					return;
				}
				
				this.$go(url)
			},
			getNetworkType() {
			   	uni.getNetworkType({
			   		success:(res) =>{
						if(res.networkType == "none"){
							this.noNetwork = true
							this.$common.errorToShow('您当前处于离线状态')
						}
			   		},
					fail: (err) => {
						console.log(err,111);
					}
			   	});
			},
			go_back() {
				let path = uni.getStorageSync("end_path");
				// console.log(path,'path');
				uni.redirectTo({
					url: path
				})
			}
		}
	}
</script>

<style lang="scss">
	.mode-bom {
		position: fixed;
		bottom: 60rpx;
		width: 100%;
		text-align: center;

		.im-fri {
			width: 315px;
			height: 55px;
			border-radius: 8px;
			opacity: 1;
			background: rgba(182, 255, 243, 0.5);
			margin: 0 auto;

			.img_a {
				float: left;
				width: 36px;
				height: 36px;
				margin-left: 15px;
				margin-top: 10px;
			}

			.tex {
				text-align: left;
				margin-top: 7px;
				margin-left: 30rpx;
				float: left;
				color: #3d3d3d;
				font-size: 16px;
				font-weight: 600;

				.weig {
					font-weight: 700;
				}

				.min {
					font-size: 12px;
					font-weight: 500;
				}
			}

			.img_b {
				float: right;
				width: 20px;
				height: 20px;
				margin-top: 15px;
				margin-right: 20px;
			}
		}

		.back {
			background: rgba(233, 255, 212, 0.5);
		}

		.con {
			width: 100%;
			height: 30rpx;
		}

		.im-tow {
			width: 315px;
			height: 55px;
			border-radius: 8px;
			opacity: 1;
			background: rgba(233, 255, 212, 0.5);
			margin: 0 auto;
		}

		.las-mg {
			margin: 0 auto;
			width: 35px;
			height: 35px;
			margin-top: 80rpx;
			border-radius: 5em;
		}

	}
</style>